1 /* 2 3 Boost Software License - Version 1.0 - August 17th, 2003 4 5 Permission is hereby granted, free of charge, to any person or organization 6 obtaining a copy of the software and accompanying documentation covered by 7 this license (the "Software") to use, reproduce, display, distribute, 8 execute, and transmit the Software, and to prepare derivative works of the 9 Software, and to permit third-parties to whom the Software is furnished to 10 do so, all subject to the following: 11 12 The copyright notices in the Software and this entire statement, including 13 the above license grant, this restriction and the following disclaimer, 14 must be included in all copies of the Software, in whole or in part, and 15 all derivative works of the Software, unless such copies or derivative 16 works are solely in the form of machine-executable object code generated by 17 a source language processor. 18 19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 DEALINGS IN THE SOFTWARE. 26 27 */ 28 29 module derelict.glib.gdataset; 30 31 import derelict.glib.gtypes; 32 import derelict.glib.glibconfig; 33 import derelict.glib.gquark; 34 35 extern (C): 36 37 alias _GData GData; 38 alias void function (uint, void*, void*) GDataForeachFunc; 39 40 struct _GData; 41 42 version(Derelict_Link_Static) 43 { 44 extern( C ) nothrow 45 { 46 void g_datalist_init(GData** datalist); 47 void g_datalist_clear(GData** datalist); 48 gpointer g_datalist_id_get_data(GData** datalist, GQuark key_id); 49 void g_datalist_id_set_data_full(GData** datalist, GQuark key_id, gpointer data, GDestroyNotify destroy_func); 50 gpointer g_datalist_id_remove_no_notify(GData** datalist, GQuark key_id); 51 void g_datalist_foreach(GData** datalist, GDataForeachFunc func, gpointer user_data); 52 void g_datalist_set_flags(GData** datalist, guint flags); 53 void g_datalist_unset_flags(GData** datalist, guint flags); 54 guint g_datalist_get_flags(GData** datalist); 55 void g_dataset_destroy(gconstpointer dataset_location); 56 gpointer g_dataset_id_get_data(gconstpointer dataset_location, GQuark key_id); 57 gpointer g_datalist_get_data(GData** datalist, const(gchar)* key); 58 void g_dataset_id_set_data_full(gconstpointer dataset_location, GQuark key_id, gpointer data, GDestroyNotify destroy_func); 59 gpointer g_dataset_id_remove_no_notify(gconstpointer dataset_location, GQuark key_id); 60 void g_dataset_foreach(gconstpointer dataset_location, GDataForeachFunc func, gpointer user_data); 61 } 62 } 63 else 64 { 65 extern( C ) nothrow 66 { 67 alias da_g_datalist_init = void function(GData** datalist); 68 alias da_g_datalist_clear = void function(GData** datalist); 69 alias da_g_datalist_id_get_data = gpointer function(GData** datalist, GQuark key_id); 70 alias da_g_datalist_id_set_data_full = void function(GData** datalist, GQuark key_id, gpointer data, GDestroyNotify destroy_func); 71 alias da_g_datalist_id_remove_no_notify = gpointer function(GData** datalist, GQuark key_id); 72 alias da_g_datalist_foreach = void function(GData** datalist, GDataForeachFunc func, gpointer user_data); 73 alias da_g_datalist_set_flags = void function(GData** datalist, guint flags); 74 alias da_g_datalist_unset_flags = void function(GData** datalist, guint flags); 75 alias da_g_datalist_get_flags = guint function(GData** datalist); 76 alias da_g_dataset_destroy = void function(gconstpointer dataset_location); 77 alias da_g_dataset_id_get_data = gpointer function(gconstpointer dataset_location, GQuark key_id); 78 alias da_g_datalist_get_data = gpointer function(GData** datalist, const(gchar)* key); 79 alias da_g_dataset_id_set_data_full = void function(gconstpointer dataset_location, GQuark key_id, gpointer data, GDestroyNotify destroy_func); 80 alias da_g_dataset_id_remove_no_notify = gpointer function(gconstpointer dataset_location, GQuark key_id); 81 alias da_g_dataset_foreach = void function(gconstpointer dataset_location, GDataForeachFunc func, gpointer user_data); 82 } 83 84 __gshared 85 { 86 da_g_datalist_init g_datalist_init; 87 da_g_datalist_clear g_datalist_clear; 88 da_g_datalist_id_get_data g_datalist_id_get_data; 89 da_g_datalist_id_set_data_full g_datalist_id_set_data_full; 90 da_g_datalist_id_remove_no_notify g_datalist_id_remove_no_notify; 91 da_g_datalist_foreach g_datalist_foreach; 92 da_g_datalist_set_flags g_datalist_set_flags; 93 da_g_datalist_unset_flags g_datalist_unset_flags; 94 da_g_datalist_get_flags g_datalist_get_flags; 95 da_g_dataset_destroy g_dataset_destroy; 96 da_g_dataset_id_get_data g_dataset_id_get_data; 97 da_g_datalist_get_data g_datalist_get_data; 98 da_g_dataset_id_set_data_full g_dataset_id_set_data_full; 99 da_g_dataset_id_remove_no_notify g_dataset_id_remove_no_notify; 100 da_g_dataset_foreach g_dataset_foreach; 101 } 102 }